<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.7"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>cpp-ipfs-http-client: ipfs::http::Transport Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">cpp-ipfs-http-client
   </div>
   <div id="projectbrief">IPFS C++ client library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.7 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceipfs.html">ipfs</a></li><li class="navelem"><b>http</b></li><li class="navelem"><a class="el" href="classipfs_1_1http_1_1Transport.html">Transport</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classipfs_1_1http_1_1Transport-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">ipfs::http::Transport Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div></div>
</div><!--header-->
<div class="contents">

<p>Convenience interface for talking basic HTTP.  
 <a href="classipfs_1_1http_1_1Transport.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="transport_8h_source.html">ipfs/http/transport.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for ipfs::http::Transport:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classipfs_1_1http_1_1Transport.png" usemap="#ipfs::http::Transport_map" alt=""/>
  <map id="ipfs::http::Transport_map" name="ipfs::http::Transport_map">
<area href="classipfs_1_1http_1_1TransportCurl.html" title="Convenience class for talking basic HTTP, implemented using CURL." alt="ipfs::http::TransportCurl" shape="rect" coords="0,56,142,80"/>
  </map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a4e3fd7f011e46562ac7d2f9005061601"><td class="memItemLeft" align="right" valign="top">virtual std::unique_ptr&lt; <a class="el" href="classipfs_1_1http_1_1Transport.html">Transport</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipfs_1_1http_1_1Transport.html#a4e3fd7f011e46562ac7d2f9005061601">Clone</a> () const =0</td></tr>
<tr class="memdesc:a4e3fd7f011e46562ac7d2f9005061601"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return a deep copy of this object.  <br /></td></tr>
<tr class="separator:a4e3fd7f011e46562ac7d2f9005061601"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a415e5830dfb8c2e26996e6619c15c8a6"><td class="memItemLeft" align="right" valign="top"><a id="a415e5830dfb8c2e26996e6619c15c8a6" name="a415e5830dfb8c2e26996e6619c15c8a6"></a>
virtual&#160;</td><td class="memItemRight" valign="bottom"><b>~Transport</b> ()</td></tr>
<tr class="memdesc:a415e5830dfb8c2e26996e6619c15c8a6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <br /></td></tr>
<tr class="separator:a415e5830dfb8c2e26996e6619c15c8a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1b9139c6d768df23da1893ff54a8d75a"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipfs_1_1http_1_1Transport.html#a1b9139c6d768df23da1893ff54a8d75a">Fetch</a> (const std::string &amp;url, const std::vector&lt; <a class="el" href="structipfs_1_1http_1_1FileUpload.html">FileUpload</a> &gt; &amp;files, std::iostream *response)=0</td></tr>
<tr class="memdesc:a1b9139c6d768df23da1893ff54a8d75a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Fetch the contents of a given URL.  <br /></td></tr>
<tr class="separator:a1b9139c6d768df23da1893ff54a8d75a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4da291ea9be5e9bcf4faccd7cbfe87fc"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipfs_1_1http_1_1Transport.html#a4da291ea9be5e9bcf4faccd7cbfe87fc">StopFetch</a> ()=0</td></tr>
<tr class="memdesc:a4da291ea9be5e9bcf4faccd7cbfe87fc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Stop the Fetch method abruptly.  <br /></td></tr>
<tr class="separator:a4da291ea9be5e9bcf4faccd7cbfe87fc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a31f96b6c63538c26c81ab5f8d806d1a5"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipfs_1_1http_1_1Transport.html#a31f96b6c63538c26c81ab5f8d806d1a5">ResetFetch</a> ()=0</td></tr>
<tr class="memdesc:a31f96b6c63538c26c81ab5f8d806d1a5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reset the internal state, after <a class="el" href="classipfs_1_1http_1_1Transport.html#a4da291ea9be5e9bcf4faccd7cbfe87fc" title="Stop the Fetch method abruptly.">StopFetch()</a> is called.  <br /></td></tr>
<tr class="separator:a31f96b6c63538c26c81ab5f8d806d1a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab06599853f7f2b11ad323a3d67df4cad"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipfs_1_1http_1_1Transport.html#ab06599853f7f2b11ad323a3d67df4cad">UrlEncode</a> (const std::string &amp;raw, std::string *encoded)=0</td></tr>
<tr class="memdesc:ab06599853f7f2b11ad323a3d67df4cad"><td class="mdescLeft">&#160;</td><td class="mdescRight">URL encode a string.  <br /></td></tr>
<tr class="separator:ab06599853f7f2b11ad323a3d67df4cad"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Convenience interface for talking basic HTTP. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a4e3fd7f011e46562ac7d2f9005061601" name="a4e3fd7f011e46562ac7d2f9005061601"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4e3fd7f011e46562ac7d2f9005061601">&#9670;&#160;</a></span>Clone()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual std::unique_ptr&lt; <a class="el" href="classipfs_1_1http_1_1Transport.html">Transport</a> &gt; ipfs::http::Transport::Clone </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Return a deep copy of this object. </p>
<dl class="section return"><dt>Returns</dt><dd>unique pointer of <a class="el" href="classipfs_1_1http_1_1Transport.html" title="Convenience interface for talking basic HTTP.">Transport</a> object </dd></dl>

<p>Implemented in <a class="el" href="classipfs_1_1http_1_1TransportCurl.html#afc09c69db3a0023675472fc3985a116d">ipfs::http::TransportCurl</a>.</p>

</div>
</div>
<a id="a1b9139c6d768df23da1893ff54a8d75a" name="a1b9139c6d768df23da1893ff54a8d75a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1b9139c6d768df23da1893ff54a8d75a">&#9670;&#160;</a></span>Fetch()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void ipfs::http::Transport::Fetch </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>url</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::vector&lt; <a class="el" href="structipfs_1_1http_1_1FileUpload.html">FileUpload</a> &gt; &amp;&#160;</td>
          <td class="paramname"><em>files</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::iostream *&#160;</td>
          <td class="paramname"><em>response</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Fetch the contents of a given URL. </p>
<p>If any files are provided in <code>files</code>, they are submitted using "Content-Type: multipart/form-data".</p>
<p>Fetch method is thread-safe. Therefor, can be used within a thread.</p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">std::exception</td><td>if any error occurs including erroneous HTTP status code </td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">url</td><td>URL to get.  </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">files</td><td>List of files to upload.  </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">response</td><td>Output to save the response body to. </td></tr>
  </table>
  </dd>
</dl>

<p>Implemented in <a class="el" href="classipfs_1_1http_1_1TransportCurl.html#a81bbb85b1a3feda8c5aa44b9c1769a6d">ipfs::http::TransportCurl</a>.</p>

</div>
</div>
<a id="a31f96b6c63538c26c81ab5f8d806d1a5" name="a31f96b6c63538c26c81ab5f8d806d1a5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a31f96b6c63538c26c81ab5f8d806d1a5">&#9670;&#160;</a></span>ResetFetch()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void ipfs::http::Transport::ResetFetch </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Reset the internal state, after <a class="el" href="classipfs_1_1http_1_1Transport.html#a4da291ea9be5e9bcf4faccd7cbfe87fc" title="Stop the Fetch method abruptly.">StopFetch()</a> is called. </p>
<p>This method needs to be called once the thread is fully finished. Ideally after client.abort() and thread.join() methods.</p>
<p>Call this method out-side of the running thread, eg. the main thread. </p>

<p>Implemented in <a class="el" href="classipfs_1_1http_1_1TransportCurl.html#a40a132f83bb069f463cab41249f4da74">ipfs::http::TransportCurl</a>.</p>

</div>
</div>
<a id="a4da291ea9be5e9bcf4faccd7cbfe87fc" name="a4da291ea9be5e9bcf4faccd7cbfe87fc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4da291ea9be5e9bcf4faccd7cbfe87fc">&#9670;&#160;</a></span>StopFetch()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void ipfs::http::Transport::StopFetch </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Stop the Fetch method abruptly. </p>
<p>When the Fetch method is used within a thead, but you want to stop the thread (without using pthread_cancel).</p>
<p>Call this method out-side of the running thread, eg. the main thread. </p>

<p>Implemented in <a class="el" href="classipfs_1_1http_1_1TransportCurl.html#a527370641262a53f2c54bf2b75451454">ipfs::http::TransportCurl</a>.</p>

</div>
</div>
<a id="ab06599853f7f2b11ad323a3d67df4cad" name="ab06599853f7f2b11ad323a3d67df4cad"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab06599853f7f2b11ad323a3d67df4cad">&#9670;&#160;</a></span>UrlEncode()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void ipfs::http::Transport::UrlEncode </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>raw</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::string *&#160;</td>
          <td class="paramname"><em>encoded</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>URL encode a string. </p>
<p>URLEcode method is thread-safe. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">raw</td><td>Input string to encode.  </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">encoded</td><td>URL encoded result. </td></tr>
  </table>
  </dd>
</dl>

<p>Implemented in <a class="el" href="classipfs_1_1http_1_1TransportCurl.html#ac53142bf9e4604695bd7414eda516bc6">ipfs::http::TransportCurl</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>/media/melroy/Data/Projects/cpp-ipfs-http-client/include/ipfs/http/<a class="el" href="transport_8h_source.html">transport.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.7
</small></address>
</body>
</html>
